{% extends "Industrial_Logs/base.html" %}
{% load bootstrap3 %}
{% block header %}
{% endblock header %}
{% block content %}
    <script src="{{ STATIC_URL }}dist/js/OtherCharts.js"></script>
    <link rel="stylesheet" href="{{STATIC_URL}}css/pageStyle.css" charset="utf-8">
    <div id="back" class="main" >
        <h1 style="color:wheat;text-align: center;font-family:cursive;font-weight:700;top:-20px;position: relative;top: 10px;">
            设备{{dev_id}}实时温湿度实时数据</h1>
        <div id="all">
            <div style="border:2px solid #666;width:80%;height: 100%;float:left" id="realTemAndHum_1"
                 class="chart-container"></div>
        </div>
    </div>

    <script>

<!--    lzz新增 根据设备名返回实时数据-->
    const data = JSON.parse('{{ dev_id|safe}}');
    console.log(data)

    {#实时温度，湿度查询#}
    $(function () {
        $.ajax({
            url: "/getRealData/"+data+"/",
            type: "POST",
            async: true,
            cache: false,
            dataType: "json", //返回数据格式为json
            success: function (data) {//请求成功完成后要执行的方法
                console.log(data);
                realTemAndHum_data(data);
            }
        });
    })
    </script>
{% endblock content %}